package conversor;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;

public class ConversorMinusculo implements Converter{

	@Override
	public Object getAsObject(FacesContext fc, UIComponent comp, String str) {
		if(str==null || str.trim().isEmpty())
			return null;
		else
			return str.toLowerCase();
	}

	@Override
	public String getAsString(FacesContext fc, UIComponent comp, Object obj) {
		if(obj==null || obj.toString().trim().isEmpty())
			return "";
		else
			return obj.toString();		
	}

}
